package com.zeros.mysplash.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * 判断网络是否连接 on 2017/12/20.
 */

public class NetWorkUtils {

    public static boolean isNetWorkAvailable(Context context) {
        ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo info = manager.getActiveNetworkInfo();

        return !(info == null || info.getState() != NetworkInfo.State.CONNECTED);
    }

}
